public class Su{
	public static void main(String[] args) {
		int i,j,count=0;
		for (i=2; i<=20000; i++) {
			for(j=2; j<i; j++){
				if(i%j==0)
				     break;
			}
			if (i==j) {
		     	     System.out.print(i+" \t"); 
		     	     count++;
		    	     if (count%5==0)
		          		System.out.println();
			}	
		}	
	}
}